package com.hzt.agprosaleplatform.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hzt.agprosaleplatform.common.CustomResponse;
import com.hzt.agprosaleplatform.entity.CategoryTree;
import com.hzt.agprosaleplatform.entity.Good;
import com.hzt.agprosaleplatform.entity.GoodsEvaluation;
import com.hzt.agprosaleplatform.entity.detailedGoods;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface GoodsService {
    List<Good> selectAll();

    List<Good> selectByCategory(String category);

    //主页搜索框
    IPage<Good> PageForCategory(String category, int pageNum, int pageSize);

        Good selectGoodsByGId(Integer gid);

    List<Good> searchGoods(String keyword);

    IPage<Good> searchGoodsPage(String keyword, int pageNum, int pageSize);

    detailedGoods selectDetailedGoodsByGId(Integer gid);

    List<CategoryTree> getCategoryTree();

    CustomResponse addNewGood(Good good, List<MultipartFile> goodsImages) throws IOException;

    String identifyImgApi(MultipartFile file) throws IOException;

    CustomResponse deleteGood(Integer gid);

    CustomResponse updateGood(Good good, List<MultipartFile> files) throws IOException;

    String EvaluateProduct(GoodsEvaluation evaluation);

    List<GoodsEvaluation> getProductEvaluate(Integer gid);
    
    /**
     * 统计店铺商品数量
     * @param shopId
     * @return
     */
    int countGoodsByShopId(Integer shopId);
    
    /**
     * 获取店铺商品销量排行
     * @param shopId
     * @return
     */
    List<Map<String, Object>> getGoodsSalesRanking(Integer shopId);
}